package utils;

import java.io.File;

public class FileUtils {

    public void deleteFiles(String path){

        File file=new File(path);
        if(file.isDirectory()){
            File[] files=file.listFiles();
            for(File f:files){
                deleteFiles(f.getPath());
            }
        }else{
            if(file.getName().endsWith(".png")){
                file.delete();
            }
        }
    }


    public static void main(String[] args){
        new FileUtils().deleteFiles("C:\\Users\\董红广\\Documents\\My RTX Files\\90924");
    }
}
